{extends file="index.tpl"}
{block name="page-content"}

<script type="text/javascript">
$(document).ready(function()
{
	$(".edit_tr").click(function()
	{
		var ID=$(this).attr('id');
		$("#name_"+ID).hide();
		$("#uniquename_"+ID).hide();
		$("#status_"+ID).hide();
		$("#order_"+ID).hide();
		$("#hotstar_"+ID).hide();
		$("#isfavorite_"+ID).hide();
		$("#isnew_"+ID).hide();
		$("#ispop_"+ID).hide();
		$("#rank_"+ID).hide();
		$("#aboutLink_"+ID).hide();
		$("#updateLink_"+ID).hide();
		$("#sortdetail_"+ID).hide();
		$("#SEOmetaDescription_"+ID).hide();

		$("#name_input_"+ID).show();
		$("#uniquename_input_"+ID).show();
		$("#status_input_"+ID).show();
		$("#order_input_"+ID).show();
		$("#hotstar_input_"+ID).show();
		$("#isfavorite_input_"+ID).show();
		$("#isnew_input_"+ID).show();
		$("#ispop_input_"+ID).show();
		$("#rank_input_"+ID).show();
		$("#aboutLink_input_"+ID).show();
		$("#updateLink_input_"+ID).show();
		$("#sortdetail_input_"+ID).show();
		$("#SEOmetaDescription_input_"+ID).show();
	}).change(function()
	{
		var ID=$(this).attr('id');
		var name=$("#name_input_"+ID).val();
		var uniquename=$("#uniquename_input_"+ID).val();
		var status=$("#status_input_"+ID).val();
		var order=$("#order_input_"+ID).val();
		var hotstar=$("#hotstar_input_"+ID).val();
		var isfavorite=$("#isfavorite_input_"+ID).val();
		var isnew=$("#isnew_input_"+ID).val();
		var ispop=$("#ispop_input_"+ID).val();
		var rank=$("#rank_input_"+ID).val();
		var aboutLink=$("#aboutLink_input_"+ID).val();
		var updateLink=$("#updateLink_input_"+ID).val();
		var sortdetail=$("#sortdetail_input_"+ID).val();
		var SEOmetaDescription=$("#SEOmetaDescription_input_"+ID).val();
		
		var dataString = 'id='+ ID +'&name='+name+'&uniquename='+uniquename+'&status='+status+'&order='+order+'&hotstar='+hotstar+'&isfavorite='+isfavorite+'&isnew='+isnew+'&ispop='+ispop+'&rank='+rank+'&sortdetail='+sortdetail+'&SEOmetaDescription='+SEOmetaDescription+'&aboutLink='+aboutLink+'&updateLink='+updateLink+'&database={if isset($data)}{$data}{else}tpg{/if}';

		$("#name_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#uniquename_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#status_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#order_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#hotstar_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#isfavorite_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#isnew_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#ispop_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#rank_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');	
		$("#aboutLink_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');	
		$("#updateLink_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');	
		$("#sortdetail_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');
		$("#SEOmetaDescription_"+ID).html('<img src="http://thanhphogame.com/admin/view/img/load.gif" />');					
		
		$.ajax({
			type: "POST",
			url: 'http://thanhphogame.com/admin/controller/process/ajaxEditTableGameCategory.php',
			data: dataString,
			cache: false,
			success: function(html)
			{
				$("#name_"+ID).html(name);
				$("#uniquename_"+ID).html(uniquename);
				$("#status_"+ID).html(status);
				$("#order_"+ID).html(order);
				$("#hotstar_"+ID).html(hotstar);
				$("#isfavorite_"+ID).html(isfavorite);
				$("#isnew_"+ID).html(isnew);
				$("#ispop_"+ID).html(ispop);
				$("#rank_"+ID).html(rank);
				$("#aboutLink_"+ID).html(aboutLink);
				$("#updateLink_"+ID).html(updateLink);
				$("#sortdetail_"+ID).html(sortdetail);
				$("#SEOmetaDescription_"+ID).html(SEOmetaDescription);
			}
		});		
	});
	
	$(".editbox").mouseup(function() {
		return false
	});
	
	$(document).mouseup(function(){
		$(".editbox").hide();
		$(".text").show();
	});

});
</script>

{literal}
<style>
	.editbox
	{
		display:none;
	}
	.editbox
	{
		font-size:14px;
		width: 70px;
		background-color:#ffffcc;
		border:solid 1px #000;
		padding:4px;
	}
	.edit_tr:hover
	{
		background:url(http://thanhphogame.com/admin/view/img/edit.png) right no-repeat #80C8E5;
		cursor:pointer;
	}

</style>
{/literal}

<div class="row-fluid">
	<div class="span12">
		<div class="block">
			
			<div class="btn-group" data-toggle="buttons-checkbox">
				<table>
					<tr>
						<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=tpg">
								<button type="submit" class="btn btn-primary {if isset($data) && $data eq 'tpg'}active{/if}">Thành Phố Game</button>
							</form>
						</td>
						<!-- <td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=cgmb">
								<button type="submit" class="btn btn-primary {if isset($data) && $data eq 'cgmb'}active{/if}">Chơi Game Mobi</button>
							</form>
						</td> -->
						<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=mmbg">
								<button type="submit" class="btn btn-primary {if isset($data) && $data eq 'mmbg'}active{/if}" >My Mobi Game</button>
							</form>
						</td>
						<!--<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=nsgt">
								<button type="submit" class="btn btn-primary {if isset($data) && $data eq 'nsgt'}active{/if}" >Ngôi Sao Game Thủ</button>
							</form>
						</td>-->
						<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=add">
								<button type="submit" class="btn btn-primary" >Thêm Game Category</button>
							</form>
						</td>
						<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=mobile">
								<button type="submit" class="btn btn-warning {if isset($data) && $data eq 'mobile'}active{/if}" >List Game Mobile</button>
							</form>
						</td>
						<td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=addMobile">
								<button type="submit" class="btn btn-warning" >Thêm Game Category Mobile</button>
							</form>
						</td>
						<!-- <td>
							<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=addMMBG">
								<button type="submit" class="btn btn-success" >Thêm Game Category MyMobiGame</button>
							</form>
						</td> -->
					</tr>
				</table>
			</div>
			<div class="row-form">
				<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database={if isset($data)}{$data}{else}tpg{/if}&filter=filterID">
					<div class="span3">
						<select name="filter" class="select" style="width: 100%;">
							{foreach from=$gameCategoryNameArr item=gameCategoryn}
								<option value="{$gameCategoryn.id}" {if isset($filter)}{if $gameCategoryn.id eq $filter}Selected{/if}{/if}>{$gameCategoryn.name}</option>	
							{/foreach}
						</select>
					</div>&nbsp;&nbsp;&nbsp;
					<button class="btn btn-primary" type="submit">&nbsp;&nbsp;&nbsp;&nbsp;Fillter&nbsp;&nbsp;&nbsp;&nbsp;</button>
	           </form><br />

				<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database={if isset($data)}{$data}{else}tpg{/if}&filter=filterParent">
					<div class="span3">
						<select name="filter" class="select" style="width: 100%;">
							<option value="2">Game Online</option>
							<option value="3">Game Offline</option>
							<option value="4">Game Web</option>
							<option value="156">Game Mod</option>
							<option value="78">Game Kinh Điển</option>
						</select>
					</div>
					&nbsp;&nbsp;&nbsp;
					<button class="btn btn-primary" type="submit">&nbsp;&nbsp;&nbsp;&nbsp;Fillter&nbsp;&nbsp;&nbsp;&nbsp;</button>
				</form><br />

				<form method="POST" action="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database={if isset($data)}{$data}{else}tpg{/if}&filter=filter">
					<div class="span3">
						<select name="filter" class="select" style="width: 100%;" data-placeholder="Choose a Country...">
							<option value="5">Game New </option>
							<option value="6">Game Popular</option>
							<option value="7">Game Rank</option>
							<option value="8">Game IsFavorite</option>
						</select>
					</div>&nbsp;&nbsp;&nbsp;
					<button class="btn btn-primary" type="submit">&nbsp;&nbsp;&nbsp;&nbsp;Fillter&nbsp;&nbsp;&nbsp;&nbsp;</button>
                </form>
			</div>
			<div class="head blue">
				<div class="icon"><i class="ico-layout-9"></i></div>
				<h2>Danh Mục Game</h2>
				<ul class="buttons">
					<li><a href="#" onClick="source('table_sort'); return false;">
					<div class="icon"><span class="ico-info"></span></div>
					</a></li>
				</ul>
			</div>
			<div class="data-fluid">
			{if isset($data)}
				{if $data eq 'tpg'}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="10%">Name</th>
								<th width="10%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="5%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="5%">Favorite</th>
								<th width="5%">isNew</th>
								<th width="5%">IsPop</th>
								<th width="5%">Rank</th>
								<th width="10%">About Link</th>
								<th width="10%">Update Link</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
						{if isset($gameCategoryArr)}
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
								</td>
								<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
								<td>
									{if $gameCategory.parent eq '2'}Game online{/if}
									{if $gameCategory.parent eq '3'}Game offline{/if}
									{if $gameCategory.parent eq '4'}Game Web{/if}
									{if $gameCategory.parent eq '156'}Game Mod{/if}
									{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
								</td>
								<td>
									<span id="status_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
										<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="order_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
								</td>
								<td>
									<span id="hotstar_{$gameCategory.id}" class="text">
		                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
										<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="isfavorite_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isFavorite ge 1}<strong style="color:red;">{$gameCategory.isFavorite}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isFavorite}" class="editbox" id="isfavorite_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="isnew_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isNew ge 1}<strong style="color:blue;">{$gameCategory.isNew}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isNew}" class="editbox" id="isnew_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="ispop_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isPop ge 1}<strong style="color:palevioletred;">{$gameCategory.isPop}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isPop}" class="editbox" id="ispop_input_{$gameCategory.id}" style="display: none;"/>									
								</td>
								<td>
									<span id="rank_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.rank ge 1}<strong style="color:steelblue;">{$gameCategory.rank}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.rank}" class="editbox" id="rank_input_{$gameCategory.id}" style="display: none;"/>																	
								</td>
								<td>
									<span id="aboutLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.about_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="aboutLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.about_link}</textarea>                           		
								</td>
								<td>
									<span id="updateLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.update_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="updateLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.update_link|htmlspecialchars}</textarea>                           		
								</td>
								<td>
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data={$data}&id={$gameCategory.id}" class="button green">
										<div class="icon"><span class="ico-pencil"></span></div>
									</a> 
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=tpg" class="button red">
										<div class="icon"><span class="ico-remove"></span></div>
									</a>
								</td>
							</tr>
						{/foreach}
						{/if}
						</tbody>
					</table>
					<div class="pagination pagination-centered">
						{if isset($pageFirst) && isset($pagePrev) && isset($pageList) && isset($pageNext) && isset($pageLast)}
	                	<ul>
	                		<li class="disabled">{$pageFirst}</li>
	                		<li class="active">{$pagePrev}</li>
	                		<li>{$pageList}</li>
	                		<li>{$pageNext}</li>
	                		<li>{$pageLast}</li>
	                    </ul>
	                    {/if}
	                </div>
	           {elseif $data eq 'mobile'}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="10%">Name</th>
								<th width="10%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="10%">Sort Detail</th>
								<th width="10%">SEO MtaDescription</th>
								<th width="15%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="10%">About Link</th>
								<th width="10%">Update Link</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
						{if isset($gameCategoryArr)}
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
								</td>
								<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
								<td>
									<span id="sortdetail_{$gameCategory.id}" class="text">
	                            		{$gameCategory.shortDetail}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="sortdetail_input_{$gameCategory.id}" style="display: none; width: 110px;">{$gameCategory.shortDetail}</textarea>															
								</td>
								<td>
									<span id="SEOmetaDescription_{$gameCategory.id}" class="text">
	                            		{$gameCategory.SEO_metaDescription}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="SEOmetaDescription_input_{$gameCategory.id}" style="display: none; width: 110px;">{$gameCategory.SEO_metaDescription}</textarea>															
								</td>
								<td>
									{if $gameCategory.parent eq '2'}Game online{/if}
									{if $gameCategory.parent eq '3'}Game offline{/if}
									{if $gameCategory.parent eq '4'}Game Web{/if}
									{if $gameCategory.parent eq '156'}Game Mod{/if}
									{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
								</td>
								<td>
									<span id="status_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
										<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="order_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
								</td>
								<td>
									<span id="hotstar_{$gameCategory.id}" class="text">
		                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
										<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="aboutLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.about_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="aboutLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.about_link}</textarea>                           		
								</td>
								<td>
									<span id="updateLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.update_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="updateLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.update_link}</textarea>                           		
								</td>
								<td>
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data={$data}&id={$gameCategory.id}" class="button green">
										<div class="icon"><span class="ico-pencil"></span></div>
									</a> 
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=mobile" class="button red">
										<div class="icon"><span class="ico-remove"></span></div>
									</a>
								</td>
							</tr>
						{/foreach}
						{/if}
						</tbody>
					</table>
					<div class="pagination pagination-centered">
						{if isset($pageFirst) && isset($pagePrev) && isset($pageList) && isset($pageNext) && isset($pageLast)}
	                	<ul>
	                		<li class="disabled">{$pageFirst}</li>
	                		<li class="active">{$pagePrev}</li>
	                		<li>{$pageList}</li>
	                		<li>{$pageNext}</li>
	                		<li>{$pageLast}</li>
	                    </ul>
	                    {/if}
	                </div>
				{elseif $data eq 'cgmb'}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="15%">Name</th>
								<th width="20%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="10%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="5%">isNew</th>
								<th width="5%">IsPop</th>
								<th width="5%">Rank</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
						{if isset($gameCategoryArr)}
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
								</td>
								<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
								<td>
									{if $gameCategory.parent eq '2'}Game online{/if}
									{if $gameCategory.parent eq '3'}Game offline{/if}
									{if $gameCategory.parent eq '4'}Game Web{/if}
									{if $gameCategory.parent eq '156'}Game Mod{/if}
									{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
								</td>
								<td>
									<span id="status_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
										<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="order_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
								</td>
								<td>
									<span id="hotstar_{$gameCategory.id}" class="text">
		                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
										<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="isnew_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isNew ge 1}<strong style="color:blue;">{$gameCategory.isNew}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isNew}" class="editbox" id="isnew_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="ispop_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isPop ge 1}<strong style="color:palevioletred;">{$gameCategory.isPop}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isPop}" class="editbox" id="ispop_input_{$gameCategory.id}" style="display: none;"/>									
								</td>
								<td>
									<span id="rank_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.rank ge 1}<strong style="color:steelblue;">{$gameCategory.rank}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.rank}" class="editbox" id="rank_input_{$gameCategory.id}" style="display: none;"/>																	
								</td>
								<td>
									<span id="aboutLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.about_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="aboutLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.about_link}</textarea>                           		
								</td>
								<td>
									<span id="updateLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.update_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="updateLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.update_link}</textarea>                           		
								</td>
								<td>
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data={$data}&id={$gameCategory.id}" class="button green">
										<div class="icon"><span class="ico-pencil"></span></div>
									</a> 
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=cgmb" class="button red">
										<div class="icon"><span class="ico-remove"></span></div>
									</a>
								</td>
							</tr>
						{/foreach}
						{/if}
						</tbody>
					</table>
					<div class="pagination pagination-centered">
	                	{if isset($pageFirst) && isset($pagePrev) && isset($pageList) && isset($pageNext) && isset($pageLast)}
	                	<ul>
	                		<li class="disabled">{$pageFirst}</li>
	                		<li class="active">{$pagePrev}</li>
	                		<li>{$pageList}</li>
	                		<li>{$pageNext}</li>
	                		<li>{$pageLast}</li>
	                    </ul>
	                    {/if}
	                </div>
	            {elseif $data eq 'mmbg'}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="15%">Name</th>
								<th width="15%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="10%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="5%">Favorite</th>
								<th width="5%">isNew</th>
								<th width="5%">IsPop</th>
								<th width="5%">Rank</th>
								<th width="10%">About Link</th>
								<th width="10%">Update Link</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
						{if isset($gameCategoryArr)}
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
								</td>
								<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
								<td>
									{if $gameCategory.parent eq '2'}Game online{/if}
									{if $gameCategory.parent eq '3'}Game offline{/if}
									{if $gameCategory.parent eq '4'}Game Web{/if}
									{if $gameCategory.parent eq '156'}Game Mod{/if}
									{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
								</td>
								<td>
									<span id="status_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
										<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="order_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
								</td>
								<td>
									<span id="hotstar_{$gameCategory.id}" class="text">
		                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
										<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="isfavorite_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isFavorite ge 1}<strong style="color:red;">{$gameCategory.isFavorite}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isFavorite}" class="editbox" id="isfavorite_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="isnew_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isNew ge 1}<strong style="color:blue;">{$gameCategory.isNew}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isNew}" class="editbox" id="isnew_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="ispop_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isPop ge 1}<strong style="color:palevioletred;">{$gameCategory.isPop}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isPop}" class="editbox" id="ispop_input_{$gameCategory.id}" style="display: none;"/>									
								</td>
								<td>
									<span id="rank_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.rank ge 1}<strong style="color:steelblue;">{$gameCategory.rank}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.rank}" class="editbox" id="rank_input_{$gameCategory.id}" style="display: none;"/>																	
								</td>
								<td>
									<span id="aboutLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.about_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="aboutLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.about_link}</textarea>                           		
								</td>
								<td>
									<span id="updateLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.update_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="updateLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.update_link}</textarea>                           		
								</td>
								<td>
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data={$data}&id={$gameCategory.id}" class="button green">
										<div class="icon"><span class="ico-pencil"></span></div>
									</a> 
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=mmbg" class="button red">
										<div class="icon"><span class="ico-remove"></span></div>
									</a>
								</td>
							</tr>
						{/foreach}
						{/if}
						</tbody>
					</table>
					<div class="pagination pagination-centered">
	                	{if isset($pageFirst) && isset($pagePrev) && isset($pageList) && isset($pageNext) && isset($pageLast)}
	                	<ul>
	                		<li class="disabled">{$pageFirst}</li>
	                		<li class="active">{$pagePrev}</li>
	                		<li>{$pageList}</li>
	                		<li>{$pageNext}</li>
	                		<li>{$pageLast}</li>
	                    </ul>
	                    {/if}
	                </div>
	            {elseif $data eq 'nsgt'}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="15%">Name</th>
								<th width="15%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="10%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="5%">Favorite</th>
								<th width="5%">isNew</th>
								<th width="5%">IsPop</th>
								<th width="5%">Rank</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
					
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
								</td>
								<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
								<td>
									{if $gameCategory.parent eq '2'}Game online{/if}
									{if $gameCategory.parent eq '3'}Game offline{/if}
									{if $gameCategory.parent eq '4'}Game Web{/if}
									{if $gameCategory.parent eq '156'}Game Mod{/if}
									{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
								</td>
								<td>
									<span id="status_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
										<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="order_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
								</td>
								<td>
									<span id="hotstar_{$gameCategory.id}" class="text">
		                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
	                            	</span>
	                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
										<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
										<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
									</select>
								</td>
								<td>
									<span id="isfavorite_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isFavorite ge 1}<strong style="color:red;">{$gameCategory.isFavorite}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isFavorite}" class="editbox" id="isfavorite_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="isnew_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isNew ge 1}<strong style="color:blue;">{$gameCategory.isNew}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isNew}" class="editbox" id="isnew_input_{$gameCategory.id}" style="display: none;"/>	
								</td>
								<td>
									<span id="ispop_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.isPop ge 1}<strong style="color:palevioletred;">{$gameCategory.isPop}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isPop}" class="editbox" id="ispop_input_{$gameCategory.id}" style="display: none;"/>									
								</td>
								<td>
									<span id="rank_{$gameCategory.id}" class="text">
	                            		{if $gameCategory.rank ge 1}<strong style="color:steelblue;">{$gameCategory.rank}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.rank}" class="editbox" id="rank_input_{$gameCategory.id}" style="display: none;"/>																	
								</td>
								<td>
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data={$data}&id={$gameCategory.id}" class="button green">
										<div class="icon"><span class="ico-pencil"></span></div>
									</a> 
									<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=nsgt" class="button red">
										<div class="icon"><span class="ico-remove"></span></div>
									</a>
								</td>
							</tr>
						{/foreach}
					
						</tbody>
					</table>
					<div class="pagination pagination-centered">
	                	{if isset($pageFirst) && isset($pagePrev) && isset($pageList) && isset($pageNext) && isset($pageLast)}
	                	<ul>
	                		<li class="disabled">{$pageFirst}</li>
	                		<li class="active">{$pagePrev}</li>
	                		<li>{$pageList}</li>
	                		<li>{$pageNext}</li>
	                		<li>{$pageLast}</li>
	                    </ul>
	                    {/if}
	                </div>
				{/if}
			{else}
					<table class="table lcnp" cellpadding="0" cellspacing="0" width="100%">
						<thead>
							<tr>
								<th><input type="checkbox" class="checkall" /></th>
								<th width="5%">ID</th>
								<th width="10%">Name</th>
								<th width="10%">Unique Name</th>
								<th width="10%">Image</th>
								<th width="5%">Parent</th>
								<th width="5%">Status</th>
								<th width="5%">Order</th>
								<th width="5%">HotStar</th>
								<th width="5%">Favorite</th>
								<th width="5%">isNew</th>
								<th width="5%">IsPop</th>
								<th width="5%">Rank</th>
								<th width="10%">About Link</th>
								<th width="10%">Update Link</th>
								<th width="10%" class="TAC">Actions</th>
							</tr>
						</thead>
						<tbody>
						{if isset($gameCategoryArr)}
						{foreach from=$gameCategoryArr item=gameCategory}
							<tr id="{$gameCategory.id}" class="edit_tr">
								<td><input type="checkbox" name="order[]" value="528" /></td>
								<td>{$gameCategory.id}</td>
								<td>
									<span id="name_{$gameCategory.id}" class="text">
	                            		{$gameCategory.name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="name_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.name}</textarea>                           		
								</td>
								<td>
									<span id="uniquename_{$gameCategory.id}" class="text">
	                            		{$gameCategory.unique_name}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="uniquename_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.unique_name}</textarea>															
							</td>
							<td><img alt="" src="{$WEB_BASE_URL}/../images/{$gameCategory.largeImage}"> </td>
							<td>
								{if $gameCategory.parent eq '2'}Game online{/if}
								{if $gameCategory.parent eq '3'}Game offline{/if}
								{if $gameCategory.parent eq '4'}Game Web{/if}
								{if $gameCategory.parent eq '156'}Game Mod{/if}
								{if $gameCategory.parent eq '78'}Game Kinh Điển{/if}
							</td>
							<td>
								<span id="status_{$gameCategory.id}" class="text">
                            		{if $gameCategory.status eq 1}Hiện {else} Ẩn {/if}
                            	</span>
                            	<select name="status" class="editbox" id="status_input_{$gameCategory.id}" style="display: none;">
									<option value="1" {if $gameCategory.status eq '1'}Selected{/if}>Hiện</option>
									<option value="0" {if $gameCategory.status eq '0'}Selected{/if}>Ẩn</option>
								</select>
							</td>
							<td>
								<span id="order_{$gameCategory.id}" class="text">
                            		{if $gameCategory.order ge 1}<strong style="color:blue;">{$gameCategory.order}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.order}" class="editbox" id="order_input_{$gameCategory.id}" style="display: none;"/>			
							</td>
							<td>
								<span id="hotstar_{$gameCategory.id}" class="text">
	                            	{if $gameCategory.hot_star eq 5}Hiện {else} Ẩn {/if}
                            	</span>
                            	<select name="hos_star" class="editbox" id="hotstar_input_{$gameCategory.id}" style="display: none;">
									<option value="5" {if $gameCategory.hot_star eq '5'}Selected{/if}>Hiện</option>
									<option value="0" {if $gameCategory.hot_star eq '0'}Selected{/if}>Ẩn</option>
								</select>
							</td>
							<td>
								<span id="isfavorite_{$gameCategory.id}" class="text">
                            		{if $gameCategory.isFavorite ge 1}<strong style="color:red;">{$gameCategory.isFavorite}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isFavorite}" class="editbox" id="isfavorite_input_{$gameCategory.id}" style="display: none;width: 30px;"/>	
							</td>
							<td>
								<span id="isnew_{$gameCategory.id}" class="text">
                            		{if $gameCategory.isNew ge 1}<strong style="color:blue;">{$gameCategory.isNew}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isNew}" class="editbox" id="isnew_input_{$gameCategory.id}" style="display: none;width: 30px;"/>	
							</td>
							<td>
								<span id="ispop_{$gameCategory.id}" class="text">
                            		{if $gameCategory.isPop ge 1}<strong style="color:palevioletred;">{$gameCategory.isPop}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.isPop}" class="editbox" id="ispop_input_{$gameCategory.id}" style="display: none;width: 30px;"/>									
							</td>
							<td>
								<span id="rank_{$gameCategory.id}" class="text">
                            		{if $gameCategory.rank ge 1}<strong style="color:steelblue;">{$gameCategory.rank}</strong>{else} 0{/if}
                            		</span>
                            		<input type="text" value="{$gameCategory.rank}" class="editbox" id="rank_input_{$gameCategory.id}" style="display: none; width: 30px;"/>																	
								</td>
								<td>
									<span id="aboutLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.about_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="aboutLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.about_link}</textarea>                           		
								</td>
								<td>
									<span id="updateLink_{$gameCategory.id}" class="text">
	                            		{$gameCategory.update_link}
                            		</span>
                            		<textarea rows="1" cols="2" class="editbox" id="updateLink_input_{$gameCategory.id}" style="display: none; width: 90px;">{$gameCategory.update_link}</textarea>                           		
						</td>
						<td>
							<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=update&data=tpg&id={$gameCategory.id}" class="button green">
								<div class="icon"><span class="ico-pencil"></span></div>
							</a> 
							<a href="{$WEB_BASE_URL}/index.php?controller=gameCategory&action=list&database=tpg" class="button red">
								<div class="icon"><span class="ico-remove"></span></div>
							</a>
						</td>
					</tr>
				{/foreach}
				{/if}
				</tbody>
			</table>
				<div class="pagination pagination-centered">
                	<ul>
                		<li class="disabled">{$pageFirst}</li>
                		<li class="active">{$pagePrev}</li>
                		<li>{$pageList}</li>
                		<li>{$pageNext}</li>
                		<li>{$pageLast}</li>
                    </ul>
                </div>
			{/if}	
			</div>
		</div>
	</div>
</div>

{/block} 
